#pragma once

#include "Scene/Behavior/WorldBehavior.h"
#include "Scene/CubeMesh.h"
#include "Render/ParticleSystem.h"
#include "Render/Shader.h"

class BlockBreakParticleSystem : public ParticleSystem {
  CubeMesh cubeMesh{};
  Ref<Shader> cubeShader;

public:
  BlockBreakParticleSystem();
  void Render(glm::mat4 MVP) override;
};

class BlockBreakParticleBehavior : public WorldBehavior {
  BlockBreakParticleSystem particleSystem;

  void EmitBlockParticle(glm::vec3 pos, glm::vec4 color);

public:
  void OnBlockBreak(Player *player, glm::ivec3 blockPos, const BlockData *block, World &world) override;
  void Update(float dt) override;
  void RenderOpaque(glm::mat4 transform, glm::vec3 playerPos, const Frustum &frustum) override;
};
